// ============================== 导入依赖 ============================== //

import * as echarts from 'echarts'

// ============================== 导出配置 ============================== //

export default {
  grid: {
    top: 36,
    left: 10,
    right: 16,
    bottom: 0,
    containLabel: true,
  },

  legend: {
    top: 6,
    right: 0,
    icon: 'roundRect',
    itemWidth: 16,
    itemHeight: 4,
    itemGap: 20,
  },

  xAxis: {
    data: [],
    boundaryGap: false,
    axisTick: {
      show: false,
    },
    axisLabel: {
      color: '#666',
    },
    axisLine: {
      lineStyle: {
        color: '#999',
      },
    },
  },

  yAxis: {
    name: '单位 :  kW·h',
    axisLabel: {
      color: '#666',
    },
    axisTick: {
      show: false,
    },
    splitLine: {
      show: false,
    },
  },

  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'cross',
      label: {
        backgroundColor: '#6a7985',
      },
    },
  },

  series: [
    {
      name: '今日',
      type: 'line',
      smooth: 0.3,
      data: [],
      showSymbol: false,
      itemStyle: {
        color: '#2D75E5',
      },
      lineStyle: {
        width: 1,
        color: '#2D75E5',
        shadowColor: '#5D96EE',
        shadowBlur: 5,
        shadowOffsetY: 8,
      },
      areaStyle: {
        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
          { offset: 0, color: 'rgba(44,117,229,.5)' },
          { offset: 1, color: '#fff' },
        ]),
      },
    },
    {
      name: '昨日',
      type: 'line',
      smooth: 0.3,
      data: [],
      showSymbol: false,
      itemStyle: {
        color: '#00B07E',
      },
      lineStyle: {
        width: 1,
        color: '#00B07E',
        shadowColor: '#04f5b4',
        shadowBlur: 5,
        shadowOffsetY: 8,
      },
      areaStyle: {
        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
          { offset: 0, color: 'rgba(0,176,126,.5)' },
          { offset: 1, color: '#fff' },
        ]),
      },
    },
  ],
}
